package com.bl.weilan.common.enums;

import com.google.common.collect.Maps;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Map;

/**
 * Created by liangweikang on 2017/9/25.
 */
@Getter
@AllArgsConstructor
public enum WechatBusinessType {

    MP(1, "公众平台"),
    APP(2, "移动应用");

    private int type;
    private String name;

    private static Map<Integer, WechatBusinessType> enumMap = Maps.newHashMap();
    static {
        for (WechatBusinessType item : values()) {
            enumMap.put(item.type, item);
        }
    }

    public static WechatBusinessType fromValue(String type) {
        WechatBusinessType item = enumMap.get(type);
        return item;
    }

}
